package com.useeinfo.oa.open.api;

import com.useeinfo.oa.common.utils.ResultUtil.ResultDto;
import com.useeinfo.oa.modules.base.biz.MessageBiz;
import com.useeinfo.oa.modules.base.enums.MessageTypeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: xudong.sun
 * @Date: 2019/1/15 16:24
 * @Description:
 */
@RestController
@RequestMapping("/api/message")
public class MessageAPI {

    @Autowired
    private MessageBiz messageBiz;

    /**
     * 消息列表
     * @param pageIndex
     * @param pageSize
     * @param searchParam
     * @param type 工单类型 （MAINTAIN 维保，INSPECTION 巡检，REPAIR 维修，AUTO 自动）
     * @param readStatus
     * @param deviceToken deviceToken
     * @param deviceType 设备类型
     * @return
     */
    @RequestMapping("/messageList")
    @ResponseBody
    public ResultDto messageList(String pageIndex, String pageSize, String searchParam, String type, Boolean readStatus, String deviceToken, String deviceType) {
        return messageBiz.messageList(pageIndex, pageSize, searchParam, type, readStatus, deviceToken, deviceType);
    }

    @RequestMapping("/getType")
    @ResponseBody
    public ResultDto getType() {
        return messageBiz.getType();
    }

    @RequestMapping("/messageDetail")
    @ResponseBody
    public ResultDto messageDetail(String id) {
        return messageBiz.messageDetail(id);
    }

}
